
import 'package:p_location/alarm/obj/job/obj_point.dart';

class Rail {
    String floorNo;
    List<PointObj> pointsList;
    String railId;
    String railName;

    Rail({this.floorNo, this.pointsList, this.railId, this.railName});

    factory Rail.fromJson(Map<String, dynamic> json) {
        return Rail(
            floorNo: json['floorNo'], 
            pointsList: json['pointsList'] != null ? (json['pointsList'] as List).map((i) => PointObj.fromJson(i)).toList() : null,
            railId: json['railId'], 
            railName: json['railName'], 
        );
    }

    Map<String, dynamic> toJson() {
        final Map<String, dynamic> data = new Map<String, dynamic>();
        data['floorNo'] = this.floorNo;
        data['railId'] = this.railId;
        data['railName'] = this.railName;
        if (this.pointsList != null) {
            data['pointsList'] = this.pointsList.map((v) => v.toJson()).toList();
        }
        return data;
    }
}